package com.spbdx.system.service.workflow.support;

import com.spbdx.system.sysdict.support.DictCategory;
import com.spbdx.system.sysdict.support.DictionaryCategory;
import com.spbdx.system.sysdict.support.DictionaryCode;

/**
 * 维保单状态字典
 *
 * @author chenwei
 * @version 1.0
 * @date 2024/8/6 15:31
 */
@DictionaryCategory(DictCategory.ORDER_TYPE)
public enum MachineStatus implements DictionaryCode {
    NEW("新单"),
    ACCEPTED("已接单"),
    CHECKED_IN("已签到"),
    MAINTENANCE_FINISHED("已完成维保"),
    FINISHED("完结");

    private String label;

    MachineStatus(String label) {
        this.label = label;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public String getLabel(String code) {
        for (MachineStatus machineStatus : MachineStatus.values()) {
            if (machineStatus.getCode().equals(code)) {
                return machineStatus.getLabel();
            }
        }
        return "";
    }

}
